<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>第十二课 DOM（DOM操作）</title>
</head> 
<body>
    <div id="div1" title="xingxingclassroom">星星课堂</div>
    <form action="" id="form1">
        <input type="text" />
        <button>按钮</button>
    </form>
    <!-- <img src="" alt="" />
    <img src="" alt="" /> -->
    <script>
        // document.getElementById();
        // document.getElementsByClassName();
        // console.log(document.doctype);
        // console.log(document.body);
        // console.log(document.domain);
        // console.log(document.title);
        // console.log(document.cookie);
        // console.log(document.URL);
        // console.log(document.forms);
        // console.log(document.images);
        // var div1 = document.getElementById('div1');
        // var form1 = document.getElementById('form1');
        // console.log(div1.nextSibling.nodeName);//#text
        // console.log(div1.nodeName);//DIV
        // console.log(div1.attributes[1].nodeName);//title
        // console.log(document.nodeName);//#document

        // console.log(div1.nodeValue);//null
        // console.log(div1.nextSibling.nodeValue);//111
        // console.log(div1.attributes[1].nodeValue);//xingxingclassroom

        // console.log(div1.nodeType);//1
        // console.log(document.nodeType);//9
        // console.log(div1.nextSibling.nodeType);//3
        // console.log(div1.attributes[1].nodeType);//2    
        // console.log(form1.nextSibling.nodeType);//8      
        // if(div1.nodeType == 1){
        //     div1.getAttribute('title');
        // }   
    </script>
</body> 
</html>